//
//  FarmSupermarketTableViewCell.m
//  PeopleStreet
//
//  Created by 刘建峰 on 16/6/27.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "FarmSupermarketTableViewCell.h"

@implementation FarmSupermarketTableViewCell

- (void)awakeFromNib {
    // Initialization code
    [self adaptiveViewLayout:self];
}
#pragma mark  调整自适应布局
- (void) adaptiveViewLayout:(UIView *)viewLayout{
        //视图自适应布局
        for (UIView *view in viewLayout.subviews) {
            view.frame = flexibleFrame(view.frame, NO);
            if ([view isKindOfClass:[UITextField class]]) {
                UITextField *viewField = (UITextField *)view;
                CGFloat fontSize = viewField.font.pointSize;
                viewField.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
            }else if ([view isKindOfClass:[UILabel class]]){
                UILabel *viewLabel = (UILabel *)view;
                CGFloat fontSize = viewLabel.font.pointSize;
                viewLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
            }else if ([view isKindOfClass:[UIButton class]]){
                UIButton *viewButton = (UIButton *)view;
                CGFloat fontSize = viewButton.titleLabel.font.pointSize;
                viewButton.titleLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
            }
            UIView *vv =view;
            for (UIView *view in vv.subviews) {
                view.frame = flexibleFrame(view.frame, NO);
                if ([view isKindOfClass:[UITextField class]]) {
                    UITextField *viewField = (UITextField *)view;
                    CGFloat fontSize = viewField.font.pointSize;
                    viewField.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
                }else if ([view isKindOfClass:[UILabel class]]){
                    UILabel *viewLabel = (UILabel *)view;
                    CGFloat fontSize = viewLabel.font.pointSize;
                    viewLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
                }else if ([view isKindOfClass:[UIButton class]]){
                    UIButton *viewButton = (UIButton *)view;
                    CGFloat fontSize = viewButton.titleLabel.font.pointSize;
                    viewButton.titleLabel.font = [UIFont systemFontOfSize:fontSize*VerticalTexeRatio()];
                }
                
            }
        }
    }


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
